﻿using System;
using System.Collections.Generic;
using Autodesk.Revit.DB;
using Autodesk.Revit.DB.Architecture;
using YJKRoomInspection.Model;
using YJKRevitKernel.FormUtility.ModelessFormControlSuite.ModelLayer;

namespace YJKRoomInspection.ShowDataForm.ModellessFrame
{
	internal class MarqueeRoomStack : IOperateStack, IAdapatResultGet
	{
		public List<AdapteRoomResulePacker> LstAdaptResult
		{
			get
			{
				return this.m_lstResult;
			}
			private set
			{
				this.m_lstResult = value;
			}
		}

		internal MarqueeRoomStack(ManualAddFrontRoomForm_ModellessVersion inputForm)
		{
			this.m_useForm = inputForm;
		}

		public void AddToStack(object input)
		{
			Level genLevel = this.m_useForm.UiDoc.ActiveView.GenLevel;
			if (input is IList<Element>)
			{
				foreach (Element element in (input as IList<Element>))
				{
					if (element is Room)
					{
						this.LstAdaptResult.Add(new AdapteRoomResulePacker
						{
							AddRoom = (element as Room),
							UseLevel = genLevel,
							AddRoomType = this.m_useForm.GetNowRoomTypeString(),
							RegionZVal = genLevel.Elevation
						});
					}
				}
			}
		}

		public void ClearStack()
		{
			this.LstAdaptResult = new List<AdapteRoomResulePacker>();
		}

		public bool TryFinishStack()
		{
			return true;
		}

		private ManualAddFrontRoomForm_ModellessVersion m_useForm;

		private List<AdapteRoomResulePacker> m_lstResult = new List<AdapteRoomResulePacker>();
	}
}
